Transparent sharding of traffic across messaging brokers

ABSTRACT

Embodiments regard transparent sharding of traffic across messaging brokers. An embodiment of a method of sharding message traffic across messaging brokers includes providing a message sharding service for message sharding among a plurality of registered message brokers, wherein providing the message sharding service includes applying a current message sharding strategy; and sharding messages among the registered message brokers according to the current message sharding strategy, including registering the message brokers and assigning message queues to registered message brokers according to the current message sharding strategy; wherein the current message sharding strategy is one of a plurality of message sharding strategies.

CROSS REFERENCE TO RELATED APPLICATIONS

This U.S. patent application is related to, and claims priority to U.S. Provisional Patent Application No. 61/941,293 filed Feb. 18, 2014, entitled “Transparent Sharding Of Traffic Across Messaging Brokers” and having Attorney Docket No. 8956P178Z (1408PROV), the entire contents of which are incorporated herein by reference.

TECHNICAL FIELD

Embodiments relate to techniques for computer database operation. More particularly, embodiments relate to transparent sharding of traffic across messaging brokers.

BACKGROUND

In a computer database system, a database shard is a horizontal partition in a database or search engine of a database system, wherein the database system includes multiple databases servers.

In a conventional operation, brokers may be configured as active/passive pairs, where queues are assigned to a single, active broker. The passive broker then is available upon a failure of the active broker.

However, the storing of every message on a single broker negatively affects system performance during peak loads, while the passive broker remains unused most of the time, resulting in compromises in performance and equipment usage.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference numerals refer to similar elements.

FIG. 1 illustrates a broker sharding service according to an embodiment;

FIG. 2 illustrates a process for recovery from message broker failure according to an embodiment;

FIG. 3 is a diagram to illustrate reservation of a queue using RAC node-based sharding according to an embodiment;

FIG. 4 is an illustration of a broker sharding interface according to an embodiment;

FIG. 5 is an illustration of configuration of sharding strategies according to an embodiment;

FIG. 6 illustrates an operation to enforce a sharding strategy according to an embodiment;

FIG. 7 is an illustration of handling of delayed or reserved queues including sharding aware operation according to an embodiment;

FIG. 8 illustrates a block diagram of an environment providing conditional selection of compound objects according to an embodiment; and

FIG. 9 illustrates details of an environment providing conditional selection of compound objects according to an embodiment.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forth. However, embodiments may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

In a computing environment, a database system may store data in multiple database servers. In such operation, a “database shard”, or simply referred to as a “shard”, is a horizontal partition in a database or search engine. Each individual partition may be referred to as a shard or database shard. Horizontal partitioning is a database design principle whereby rows of a database table (referring to elements for a particular entry) are held separately in a database, rather than being split into columns. Each such partition forms part of a shard, which may in turn be located on a separate database server or physical location.

In a conventional operation, Qpid™ message broker servers (which may also be referred to herein as message brokers, or simply brokers) deployed for message queues are configured as active/passive pairs, wherein all queues are assigned to a single, active broker, leaving the remaining passive broker mostly idle for high availability reasons. Qpid is a trademark of The Apache Software Foundation, Qpid being an open source messaging system implementing the Advanced Messaging Queuing Protocol (AMQP), an open standard application layer protocol for messaging.

However, in large systems, as traffic is, for example, migrated to Qpid message brokers, storing every message on a single broker will impact enqueue/dequeue performance during peak load. In some embodiments, in order to preempt potential resource bottlenecks (such as memory and processor limitations) on a single broker, traffic is sharded and distributed across multiple brokers, wherein the distribution may be horizontally scaled beyond two brokers.

In some embodiments, a service in a database system provides for sharding across multiple message brokers. In conventional operation, message brokers are concurrently configured as active/passive, with the passive broker being idle most of the time. Sharding across multiple message brokers allows for preempting memory pressures at peak load as traffic grows and distributing load evenly among brokers by RAC node, wherein “RAC node” refers to Oracle® Real Application Clusters. In such operation, there are issues to addressed, including the migration of existing queues once deployed, the preservation of round-robin fairness within same RAC node and tier; and no longer having a process simply fall back on a second broker when a first broker is out of queues.

In many large distributed messaging services, the decision to horizontally scale computing resources (such as processor, memory, storage, and other resources) across multiple machines (referred to as sharding) is tightly coupled with other components of the system. As such, changing the sharding strategy to provide, for instance, better load distribution or replication generally requires significant changes to the code for the system. In some embodiments, broker sharding may be provided as a service for clusters of messaging brokers to distribute messaging load evenly across multiple brokers and to provide scalability and high availability on top of an asynchronous job processing infrastructure. In some embodiments, sharding APIs (Application Programming Interfaces) utilized for building such a broker sharding service implement multiple forms of sharding, thus avoiding the need for extensive re-coding.

In some embodiments, broker sharding is provided as a service, thereby decoupling the broker sharding strategy from the remaining components of the messaging service. As described herein, in some embodiments a set of sharding APIs is offered by such a broker sharding service. This decoupled approach allows implementers to customize and swap sharding algorithms to satisfy, for example, different performance bounds, business requirements, availability guarantees, network conditions, or user preferences. In some embodiments, the current sharding strategy may be swapped in response to, for example, a change in current conditions, such as a change in traffic levels, or a change in a user preference. In an example, a sharding service can monitor for resource utilization on the broker hosts and dynamically redistribute traffic for service level guarantees, or replicate queuing resources across multiple brokers to improve availability guarantees.

In some embodiments, broker sharding as a service framework is an intermediate layer between broker servers (such as Qpid broker servers), which makes queuing resources available for use, and the routing table, which regulates messaging traffic by reserving queuing resources. In some embodiments, the broker sharding service provides APIs for allocating queuing resources from the set of available brokers. In some embodiments, consumers (such as the routing table) of this service can choose from among multiple sharding strategies in order to, for example, make trade-offs between availability and scalability goals depending on application requirements.

In some embodiments, implementation details for broker sharding are abstracted via the APIs that allow service consumers to dynamically and seamlessly swap sharding strategies. In some embodiments, at least two sharding strategies are provided that can be configured during application server startup, the sharding strategies being RAC node-based sharding and active/passive sharding. In operation, the RAC node-based sharding allows load balancing by evenly distributing customer traffic across two or more broker servers. The active/passive sharding offers simplicity for debugging issues that arise in production.

In some embodiments, transparent broker sharding across multiple message brokers provides the following:

(1) Broker sharding as a service framework for achieving scalability and high availability across N brokers;

(2) A set of sharding APIs (which specifically may be hardened APIs, hardening referring to the writing of API code to address security concerns) for abstracting management of queuing resources on brokers; and

(3) Multiple versions of sharding with the ability to make performance trade-offs by swapping between strategies.

Message queue systems can process hundreds of millions of user and internal jobs daily (wherein the term “jobs” refers to messages). In an example, a message queue in the salesforce.com system is a highly distributed, asynchronous job scheduling and processing system for messages currently spanning 600 distinct job types. These jobs include both customer facing jobs (generating dashboard reports) and internal jobs (cleaning up database rows for inactive tenants). Jobs are organized by job type/tenant combination in which each combination corresponds to a distinct physical queue residing on one Qpid broker. In a particular embodiment of an asynchronous job scheduling (Message Queue) framework, these jobs are queued on Apache Qpid message broker servers. Application servers that process these jobs subscribe to queues from the Qpid brokers and pull messages to be de-queued, executed, and finally discarded. In some embodiments, between the application servers and the Qpid brokers is a routing table, which maintains a mapping of message types and tenants to physical queues on the Qpid message brokers. In this example, queues are identified by a named component, such as “Q123”, and a broker identification (ID), such as a unique 15-character broker ID. A routing table may be as described in U.S. patent application Ser. No. 13/841,489, published as U.S. Patent Application Publication No. 2014/0075445, which application is incorporated by reference in its entirety.

In some embodiments, broker sharding as a service framework operates as an intermediate layer between the broker servers and the routing table. In one embodiment, multiple broker servers are deployed to each production instance serving as active and passive roles respectively. In some embodiments, the routing table only maps message types and tenants to physical queues on the active broker, while the passive broker is kept idle and void of traffic.

In general operation with active-passive broker implementation, if the active broker fails or otherwise stops operating, new and existing messages are moved to the passive broker and a switch is flipped to mark the passive server as active. In this manner, application servers are only required to subscribe to and allocate queues from the active broker. However, this structure presents several challenges: (1) modification of the active/passive configuration requires tedious code changes to both the routing table and application servers, (2) slower recovery occurs because once the active broker stops operating, all message processing stops until each message is recovered on the passive broker, and (3) the processing load cannot be distributed by horizontally scaling messaging traffic across both (or N) brokers.

In some embodiments, addressing these problems, a transparent sharding is provided as a service framework that serves as an intermediate layer between the routing table and broker servers in a system. In such operation, the sharding service offers common APIs for allocating queuing resources from the set of available brokers. In turn, consumers of this service can choose among multiple sharding strategies to make trade-offs between availability and scalability goals depending on application requirements. Further, implementation details are abstracted via APIs that allow consumers to seamlessly swap sharding strategies.

FIG. 1 illustrates a broker sharding service according to an embodiment. In some embodiments, a database system may include a cluster of message broker servers (which may be referred to as broker hosts, illustrated as broker hosts B1 through Bn) 102, a routing table 140, and a broker sharding service 110 between the broker hosts 102 and the routing table 140. In some embodiments, a routing operation may utilize the routing table as a consumer and an Apache Qpid broker as a queuing resource. However, embodiments are not limited by this implementation, and the consumer may be any application that needs to allocate new queuing resources on a set of N message broker servers.

In some embodiments, the broker sharding service includes a broker monitor 112, including a broker registry 114, and a queue registry 116. In some embodiments, the broker sharding service 110 may aggregate health status of broker hosts 104, wherein the broker sharding service 110 is to utilize the broker monitor 112 to collect a list of healthy brokers 120 and the queue registry 116 to collect a list of reserved queues 122. In some embodiments, such information is used in connection with a current sharding strategy 118, wherein the current sharding strategy is one of a plurality of possible sharding strategies and wherein the current sharding strategy may be switched to a different sharding strategy as required.

In some embodiments, the broker sharding service 110 includes the provision of sharding APIs 124. In some embodiments, the following APIs are made available via the broker sharding as a service framework:

(a) Register Broker 130: In some embodiments, a Qpid message broker 102 makes its queuing resources available for use by first registering with the sharding service 110. The sharding service 110 maintains the registry 114 of these message brokers and can optionally implement the broker monitor 112 that periodically queries registered message brokers for health status (wherein the health status may include heap and CPU load, for example).

(b) Unregister Broker 132: In some embodiments, the API removes a particular message broker from consideration by the sharding service 110, meaning that no new queues will be assigned to this message broker and existing queues will be redistributed across the remaining available message brokers according to the sharding strategy 118. In some embodiments, two sources can remove a message broker: First, application servers may run a quorum based health checker for detecting connectivity issues with the broker (network partition, broker failure, excess load, etc.) and explicitly request that the problematic broker be removed from the sharding service. A quorum-based health checker may include operation as described in U.S. patent application Ser. No. 13/841,588, published as U.S. Patent Application Publication No. 2014/0075017, which application is incorporated by reference in its entirety. Second, alternatively, the sharding service 110 may implement the broker monitor 112 that pings the message broker for liveliness and that removes a message broker if the broker becomes unreachable.

(3) Get Broker for Queue 134: In some embodiments, the API allows the routing table 140 to request a new queue for use. In some embodiments, the sharding service 110 finds and returns an available Qpid broker server (or multiple brokers for replication) by applying a specified sharding strategy 118 and using broker health and the assignment of existing queues to brokers as input.

(4) Drop queue from Broker 136: When a queue is no longer used by the routing table 140, the routing table 140 may invoke this API to drop the queue from the message broker. The dropping of the queue then frees up capacity on the broker.

(5) Redistribute Queues 138: In some embodiments, the routing table 140 may invoke this API to redistribute existing queues among the registered set of message brokers. In some embodiments, the sharding service 110 may choose to migrate an existing queue to a different broker depending on the sharding strategy 118 (such as to achieve load balancing, replication, or availability goals). In an implementation, the migration of a queue is initiated by the routing table 140 when the routing table 140 detects external state changes such as broker failure or excess load.

However, embodiments are not limited to these particular APIs, and may include different or additional APIs depending on a particular implementation.

In some embodiments, the broker sharding service APIs are invoked by the routing table sweeper job to determine (1) the destination message broker for queues assigned to new routing rules, and 2) the correct message broker for existing routing rules that are currently assigned to a wrong broker according to a sharding strategy. Upon the sharding feature being enabled, messages are migrated on a subset of existing queues to a different message broker in order to conform to a sharding strategy. A main contribution of the broker sharding service for sharding operation is to decouple routing and scheduling decisions from the sharding strategy and allow for future sharding strategies that trade-off availability and load balancing goals.

In some embodiments, multiple sharding strategies (such as sharding strategy 118 illustrated in FIG. 1) are implemented that can be configured during application server startup. In some embodiments, the current sharding strategy may be switched to a different strategy as, for example, conditions or preferences change. In some embodiments, the multiple sharding strategies include, but are not limited to:

(1) RAC Node-Based Sharding:

RAC node-based sharding uses the parent RAC node identifier of messages assigned to a queue to load balance traffic across N Qpid message brokers. In an operation in which customers or tenants are partitioned by RAC node, this feature may be applied to partition messages from various tenants. Further, because performance engineers actively monitor tenant to RAC node assignments in production data centers for load balancing of database resources, RAC node-based sharding may inherit these load balancing benefits without requiring additional cost or overhead. Specifically, tenants that generate large database loads are more likely to incur high messaging volume.

In some embodiments, sharding by RAC node (QpidBrokerShardingByRacNode) includes the following characteristics:

(a) Physical queues are assigned to message brokers based on RAC node;

(b) When running the routing table sweeper job, the sharding service queries for the latest list of active Qpid brokers and physical queues reserved on each broker; and

(c) When reserving a new queue, the preferred message broker is determined via modulo hashing of RAC node ID into the list of available brokers.

(2) Active/Passive Sharding:

Active/passive sharding may be provided primarily for legacy purposes. Due to the simplicity of the active/passive algorithm (i.e., one destination broker for all queues), this makes for a useful tool when there is a need for debugging production issues by isolating problems on a single broker.

In some embodiments, sharding by active/passive broker operation (QpidBrokerShardingByActivePassive) includes the following characteristics:

(a) All physical queues are assigned to a single active broker;

(b) When running the routing table sweeper job, the sharding service queries for the latest list of active Qpid brokers and physical queues reserved on each broker; and

(c) The sharding service chooses the active broker as follows:

-   -   (i) If no queues are currently reserved or the queues all point         to a failed broker, then select the broker with a lowest         lexicologically ordered identification (ID) (wherein each broker         is assigned a unique ID at creation), or     -   (ii) Otherwise, count the number of queues assigned to each         broker and choose the broker with the most queues reserved; and

(d) The preferred broker is always the current active broker.

FIG. 2 illustrates a process for recovery from message broker failure according to an embodiment. In some embodiments, a process for recovery from broker failure 200 includes collecting health status for a message broker from the broker monitor, such as broker monitor 112 of broker sharding service 110 illustrated in FIG. 1, the collection of health status information includes inquiries regarding whether the message broker is down (is not operating for any reason) 204; whether the message broker has excessively high processor usage (such as CPU, central processing unit) usage 206 (such as a processor usage above a certain threshold amount), and whether the message broker has an excessively high heap value 208 (such as a heap value above a certain threshold amount). However, embodiments are not limited to these particular health status inquiries, or to any particular order of health status inquiries. If answer to each inquiry is negative, indicating that the message broker is available, then the process may continue to a next broker 210.

In some embodiments, if there is a determination by the broker monitor that a message broker is unavailable according to any of inquiries 204, 206, and 208, then the broker service notifies the routing table regarding the unavailable message broker 212, and unregisters the unavailable broker from the broker registry 214 (such as broker registry 114 illustrated in FIG. 1).

In some embodiments, the queues of the unavailable message broker are redistributed to remaining brokers, such as by modulo hashing by RAC node ID for RAC node-based sharding 216. The broker service may then update the queue registry and notify the routing table 218.

FIG. 3 is a diagram to illustrate reservation of a queue using RAC node-based sharding according to an embodiment. In a queue reservation process 300, a routing table 302 may operate to obtain a message broker for a new queue (Q15 in this example) on a particular RAC node (RAC node 2) 310 according to a current sharding strategy 304.

In some embodiments, a destination broker A is computed for queue Q15, RAC node 2 using modulo hashing 312. In some embodiments, a status of all healthy message brokers is collected 314 by the broker registry 308, and a list of reserved queues on each message broker is collected 316 from the queue registry 306. In some embodiments, the load and availability on message broker A is verified 318, with RAC node 2 queues optionally being relocated to another broker as needed.

In some embodiments, the queue Q15, RAC node 2 is registered on message broker A 320 using queue registry 306. In some embodiments, broker A is returned to the routing table as the destination for queue Q15 322.

In RAC node-based sharding, migration of existing traffic may be necessary in order to preserve round robin fairness across queues within the same RAC node. Round robin fairness means that every physical queue within the same RAC node partition has an equal or near equal chance of being selected for de-queue and processing. That is, if queues A and B belong to the same RAC node, then for every X messages a system de-queues and processes from queue A, the system should de-queue, on average, X messages from queue B. In some embodiments, this guarantee or goal is provided between queues assigned to the same message broker but not across multiple brokers.

In an example, ACS_DELETE traffic on RAC node 1, tier 1 is routed to a queue on message broker A while APEX_FUTURE on RAC node 1, tier 1 is routed to a queue on message broker B. If the volume of messages on broker A is much higher, then it will adversely impact dequeue performance on broker A such that APEX_FUTURE messages are dequeued at a faster rate from Broker B than ACS_DELETE messages. If queues within the same RAC node are restricted to a single message broker, then this problem may be avoided by virtue of selecting messages in a round-robin fashion across queues within the same broker. As such, following broker failure, messages for all queues belonging to the same RAC node are migrated to a single, remaining broker.

In some embodiments, periodically (for example, every fifteen minutes), a routing table sweeper job runs to enforce fair usage, handle broker failures, add rules for new message types, and other functions. In some embodiments, two additional extra processes may be added to enforce the broker sharding strategy. First, new message brokers added to the system are registered with the sharding service and failed message brokers are unregistered. Next, after the routing table sweeper job loads the list of currently reserved queues, the routing table sweeper job queries the broker sharding service to redistribute existing queues among the set of available message brokers (i.e. load balancing queues from a RAC node to a newly introduced broker). This redistribution logic may be encapsulated in the QpidBrokerSharding interface. Finally, when reserving a queue for each newly created routing rule, the sharding service is queried for the destination message broker ID and then there is an attempt to select an unused queue from that broker. Similarly, when routing rules are removed, the corresponding queue is released from its destination broker.

FIG. 4 is an illustration of a broker sharding interface according to an embodiment. In some embodiments, the interface 400 (QpidBrokerSharding Interface) includes a listing of active brokers 420 and routing rules/queue 430. In one example, a particular routing rule 410 may indicate a RAC Node (RAC Node 1 in this example); an organization identification (OrgId=0x0000cD) for a tenant; and a message type (ASYNC_API). In some embodiments, interface 400 will determine a preferred message broker 440 (na1-mq1-1-sj1 in this example).

FIG. 5 is an illustration of configuration of sharding strategies according to an embodiment. In some embodiments, a configuration of sharding strategies 500 provides for swapping between multiple sharding strategies via the illustrated XML configuration file 505. In some embodiments, the possible sharding strategies include, but are not limited to, RAC node-based sharding (QpidBrokerShardingByRacNode) 510 and active/passive broker sharding (QpidBrokerShardingByActivePasive) 520.

In some embodiments, the RAC node-based sharding 510 includes modulo hashing of a RAC node ID into a list of active brokers 515.

In some embodiments, the active/passive broker sharding 520 includes a broker that is assigned the largest number of existing queues being marked as the “active” broker 525, wherein a tie is broken by lexicological ordering of broker IDs for the available brokers 530.

In some embodiments, in conjunction with broker sharding as a service, two additional components are modified that impact how queues are reserved for new routing rules and which broker is use for reserved and delayed queues. When attempting to reserve a queue for a new routing rule, a preferred broker ID is attached based on the sharding strategy. In an implementation, if there are no available queues on the preferred message broker, rather than reserving a queue from an alternate broker, the reservation operation terminates with an error. This preserves round robin fairness by grouping all queues belonging to the same RAC node on the same broker.

In addition, an embodiment may include selecting a delayed (for messages enqueued with a delay) or reserved (for messages enqueued before the routing table is loaded) queue, with the destination message broker being the broker with the lowest lexicologically ordered ID. In an implementation in which there is sharding by RAC node, traffic will be evenly distributed across each broker. As a result, if a service continues to use only delayed queues on the broker with the lowest lexicologically ordered ID, then there is a need to update the broker ID in the message transaction table of the database for, on average, (N−1)/N fraction of the delayed messages for a set of N message brokers. This results because, on average, N−1 out of N messages will be routed to queues residing on a different broker (according to the RAC node of the message) rather than the delayed queue once the delay expires.

In some embodiments, in order to prevent unnecessary broker ID updates to the message transaction table, the router object (QpidMessageQueueRouter) is augmented to be sharding aware. Sharding awareness means that, when the router assigns delayed or reserved queues to incoming messages, the router queries the sharding service to retrieve the preferred broker based on the RAC node of the newly enqueued message. This process may be used to ensure the same destination broker is used before and after a delayed message expires. The local cache of the sharding service state (referenced by the router) is updated at periodic (for example, 5-minute) intervals by the routing table sweeper job. The cache can be stale such that messages enqueued with a delay may be routed to an incorrect broker immediately following a broker failure.

FIG. 6 illustrates an operation to enforce a sharding strategy according to an embodiment. In some embodiments, in an operation to enforce a sharding strategy 600, an interface (QpidBrokerSharding) 640 operates with a routing table 605. As illustrated, active broker IDs 610 and all rules/queues 620 are received for handling by the interface 640.

In some embodiments, a router table sweeper job 630 may provide updates at certain X-minute intervals 630, wherein the routing table sweeper job operates to enforce the chosen sharding strategy.

In the illustration provided in FIG. 6, the routing table sweeper job 630 provides correction of broker routing to enforce the chosen sharding strategy such as, in this example, modifying broker assignments for RAC node 2 to be directed to preferred broker na1-mq2 and RAC node 1 to be directed to preferred broker Na1-mq1.

In some embodiments, a sharding strategy is provided by implementing the QpidBrokerSharding interface, including the following operations:

(a) getPreferredBrokerldForRule: Returns the broker ID for the specified routing rule or RAC node.

(b) setAvailableBrokerlds: Initializes the set of Qpid brokers that are available for enqueue/dequeue.

(c) setInUseRoutingRules: Initializes the set of routing rules/queues currently reserved by the router. Queues may be mapped to a failed broker, in which case the sharding strategy will release the prior queue and reserve a replacement queue on one of the remaining brokers.

(d) remapRulesToBrokers: Re-compute the assignment of rules/queues to brokers. In an implementation, setInUseRoutingRules is to be invoked before calling getPreferredBrokerldForRule. In some embodiments, the sequencing of these processes is handled automatically by the routing table sweeper job.

In some embodiments, in order to change the Qpid broker sharding strategy, the “BrokerShardingStrategy” parameter is updated via an XML configuration file. In some embodiments, the sharding strategy may be dynamically changed as needed.

FIG. 7 is an illustration of handling of delayed or reserved queues including sharding aware operation according to an embodiment. In some embodiments, handling of delayed/reserved queues 700 may be addressed with one of multiple different strategies. For delayed/reserved queues 700, a first strategy provides queues according to lexicological ordering of broker IDs, such as using the lowest lexicologically ordered broker ID 720. In operation, for sharding by RAC node, delayed or reserved messages are routed according the sharding strategy upon expiration 722.

However, in such process in which queues are partitioned across multiple brokers, sharding by RAC node will mean that a large percentage of delayed/reserved messages, such as approximately 50% in balancing between two brokers, will be routed to a different broker upon expiration, requiring many database operations to update the message transaction table of the database.

In some embodiments, a second alternative strategy utilizes sharding aware operation 730. In some embodiments, there is reference to the sharding service in the router, and in operation delayed/reserved queues are provided by RAC node, thereby eliminating the need to update the broker ID of delayed/reserved messages in the message transaction table.

In some embodiments, a method of sharding message traffic across messaging brokers includes: providing a message sharding service for message sharding among a plurality of registered message brokers, wherein providing the message sharding service includes applying a current message sharding strategy, the current message sharding strategy being one of a plurality of message sharding strategies; and sharding messages among the registered message brokers according to the current message sharding strategy, including registering the message brokers and assigning message queues to registered message brokers according to the current message sharding strategy; wherein the current message sharding strategy is one of a plurality of message sharding strategies.

In some embodiments, a method for recovery from message broker failure includes: determining a health status of each of a plurality of message brokers by a broker monitor of a broker sharding service; upon determining that a first message broker is unavailable, notifying a routing table regarding the unavailable broker; redistributing message queues from the first message broker to one or more remaining message brokers according to a selected message sharding strategy, the selected message sharding strategy being implemented by the broker sharding service; and notifying the routing table regarding the redistribution of message queues.

In some embodiments, a messaging system includes: a plurality of message brokers, the message brokers to store queues of message; a routing table to map message types and tenants to physical queues on the message brokers; and a message sharding service to provide message sharding among the plurality of message brokers according to a message sharding strategy; wherein the message sharding service is operable to switch between two or more message sharding strategies.

In some embodiments, a non-transitory computer-readable storage medium having stored thereon data representing sequences of instructions that, when executed by a processor, cause the processor to perform operations including: providing a message sharding service for message sharding among a plurality of registered message brokers, wherein providing the message sharding service includes applying a current message sharding strategy; and sharding messages among the registered message brokers according to the current message sharding strategy, including registering the message brokers and assigning message queues to registered message brokers according to the current message sharding strategy; wherein the current message sharding strategy is one of a plurality of message sharding strategies.

The examples illustrating the use of technology disclosed herein should not be taken as limiting or preferred. This example sufficiently illustrates the technology disclosed without being overly complicated. It is not intended to illustrate all of the technologies disclosed. A person having ordinary skill in the art will appreciate that there are many potential applications for one or more implementations of this disclosure and hence, the implementations disclosed herein are not intended to limit this disclosure in any fashion.

One or more implementations may be implemented in numerous ways, including as a process, an apparatus, a system, a device, a method, a computer readable medium such as a computer readable storage medium containing computer readable instructions or computer program code, or as a computer program product comprising a computer usable medium having a computer readable program code embodied therein.

Other implementations may include a non-transitory computer readable storage medium storing instructions executable by a processor to perform a method as described above. Yet another implementation may include a system including memory and one or more processors operable to execute instructions, stored in the memory, to perform a method as described above.

FIG. 8 illustrates a block diagram of an environment providing conditional selection of compound objects according to an embodiment, and FIG. 9 illustrates details of an environment providing conditional selection of compound objects according to an embodiment. Components within an environment 810 may belong to different layers (e.g., compute, management) and may communicate as described above. Environment 810 may include user systems 812, network 814, system 816, processor system 817, application platform 818, network interface 820, tenant data storage 822, system data storage 824, program code 826, and process space 828. In other embodiments, environment 810 may not have all of the components listed and/or may have other elements instead of, or in addition to, those listed above.

Environment 810 is an environment in which an on-demand database service exists. User system 812 may be any machine or system that is used by a user to access a database user system. For example, any of user systems 812 can be a handheld computing device, a mobile phone, a laptop computer, a work station, and/or a network of computing devices. As illustrated in FIG. 8, and in more detail in FIG. 9, user systems 812 might interact via a network 814 with an on-demand database service, which is system 816.

An on-demand database service, such as system 816, is a database system that is made available to outside users that do not need to necessarily be concerned with building and/or maintaining the database system, but instead may be available for their use when the users need the database system (e.g., on the demand of the users). Some on-demand database services may store information from one or more tenants stored into tables of a common database image to form a multi-tenant database system (MTS). Accordingly, “on-demand database service 816” and “system 816” will be used interchangeably herein.

A database image may include one or more database objects. A relational database management system (RDMS) or the equivalent may execute storage and retrieval of information against the database object(s). Application platform 818 may be a framework that allows the applications of system 816 to run, such as the hardware and/or software, e.g., the operating system. In an embodiment, on-demand database service 816 may include an application platform 818 that enables creation, managing and executing one or more applications developed by the provider of the on-demand database service, users accessing the on-demand database service via user systems 812, or third party application developers accessing the on-demand database service via user systems 812.

The users of user systems 812 may differ in their respective capacities, and the capacity of a particular user system 812 might be entirely determined by permissions (permission levels) for the current user. For example, where a salesperson is using a particular user system 812 to interact with system 816, that user system has the capacities allotted to that salesperson. However, while an administrator is using that user system to interact with system 816, that user system has the capacities allotted to that administrator. In systems with a hierarchical role model, users at one permission level may have access to applications, data, and database information accessible by a lower permission level user, but may not have access to certain applications, database information, and data accessible by a user at a higher permission level. Thus, different users will have different capabilities with regard to accessing and modifying application and database information, depending on a user's security or permission level. Network 814 is any network or combination of networks of devices that communicate with one another. For example, network 814 can be any one or any combination of a LAN (local area network), WAN (wide area network), telephone network, wireless network, point-to-point network, star network, token ring network, hub network, or other appropriate configuration. As the most common type of computer network in current use is a TCP/IP (Transfer Control Protocol and Internet Protocol) network, such as the global internetwork of networks often referred to as the Internet, that network will be used in many of the examples herein. However, it should be understood that the networks that are used in one or more implementations may not be so limited, although TCP/IP is a frequently implemented protocol.

User systems 812 might communicate with system 816 using TCP/IP and, at a higher network level, use other common Internet protocols to communicate, such as HTTP, FTP, AFS, WAP, etc. In an example where HTTP is used, user system 812 might include an HTTP client commonly referred to as a “browser” for sending and receiving HTTP messages to and from an HTTP server at system 816. Such an HTTP server might be implemented as the sole network interface between system 816 and network 814, but other techniques might be used as well or instead. In some implementations, the interface between system 816 and network 814 includes load sharing functionality, such as round-robin HTTP request distributors to balance loads and distribute incoming HTTP requests evenly over a plurality of servers. At least as for the users that are accessing that server, each of the plurality of servers has access to the MTS' data; however, other alternative configurations may be used instead.

In one embodiment, system 816, shown in FIG. 8, implements a web-based customer relationship management (CRM) system. For example, in one embodiment, system 816 includes application servers configured to implement and execute CRM software applications as well as provide related data, code, forms, webpages and other information to and from user systems 812 and to store to, and retrieve from, a database system related data, objects, and Webpage content. With a multi-tenant system, data for multiple tenants may be stored in the same physical database object, however, tenant data typically is arranged so that data of one tenant is kept logically separate from that of other tenants so that one tenant does not have access to another tenant's data, unless such data is expressly shared. In certain embodiments, system 816 implements applications other than, or in addition to, a CRM application. For example, system 816 may provide tenant access to multiple hosted (standard and custom) applications, including a CRM application. User (or third party developer) applications, which may or may not include CRM, may be supported by the application platform 818, which manages creation, storage of the applications into one or more database objects and executing of the applications in a virtual machine in the process space of the system 816.

One arrangement for elements of system 816 is shown in FIG. 8, including a network interface 820, application platform 818, tenant data storage 822 for tenant data 823, system data storage 824 for system data 825 accessible to system 816 and possibly multiple tenants, program code 826 for implementing various functions of system 816, and a process space 828 for executing MTS system processes and tenant-specific processes, such as running applications as part of an application hosting service. Additional processes that may execute on system 816 include database indexing processes.

Several elements in the system shown in FIG. 8 include conventional, well-known elements that are explained only briefly here. For example, each user system 812 could include a desktop personal computer, workstation, laptop or notebook, tablet computer, smart phone, cell phone, or any wireless access protocol (WAP) enabled device or any other computing device capable of interfacing directly or indirectly to the Internet or other network connection. User system 812 typically runs an HTTP client, e.g., a browsing program, such as Microsoft's Internet Explorer, Firefox, Chrome, or a mobile operating system browser in the case of a smart phone, cellular phone, or other wireless device, or the like, allowing a user (e.g., subscriber of the multi-tenant database system) of user system 812 to access, process and view information, pages and applications available to it from system 816 over network 814. Each user system 812 also typically includes one or more user interface devices, such as a keyboard, a mouse, trackball, touch pad, touch screen, pen, gesture recognition, or the like, for interacting with a graphical user interface (GUI) provided by the browser on a display (e.g., a monitor screen, LCD display, etc.) in conjunction with pages, forms, applications and other information provided by system 816 or other systems or servers. For example, the user interface device can be used to access data and applications hosted by system 816, and to perform searches on stored data, and otherwise allow a user to interact with various GUI pages that may be presented to a user. As discussed above, embodiments are suitable for use with the Internet, which refers to a specific global internetwork of networks. However, it should be understood that other networks can be used instead of the Internet, such as an intranet, an extranet, a virtual private network (VPN), a non-TCP/IP based network, any LAN or WAN or the like.

According to one embodiment, each user system 812 and all of its components are operator configurable using applications, such as a browser, including computer code run using a central processing unit such as an Intel processor, including Celeron®, Pentium®, Core®, and Xeon® processors, or the like. Similarly, system 816 (and additional instances of an MTS, where more than one is present) and all of their components might be operator configurable using application(s) including computer code to run using a central processing unit such as processor system 817, which may include an Intel processor or the like, and/or multiple processor units.

A computer program product embodiment includes a machine-readable storage medium (media), including non-transitory computer-readable storage media, having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the embodiments described herein. Computer code for operating and configuring system 816 to intercommunicate and to process webpages, applications and other data and media content as described herein are preferably downloaded and stored on a hard disk, but the entire program code, or portions thereof, may also be stored in any other volatile or non-volatile memory medium or device as is well known, such as a ROM or RAM, or provided on any media capable of storing program code, such as any type of rotating media including floppy disks, optical discs, digital versatile disk (DVD), compact disk (CD), microdrive, and magneto-optical disks, and magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data. Additionally, the entire program code, or portions thereof, may be transmitted and downloaded from a software source over a transmission medium, e.g., over the Internet, or from another server, as is well known, or transmitted over any other conventional network connection as is well known (e.g., extranet, VPN, LAN, etc.) using any communication medium and protocols (e.g., TCP/IP, HTTP, HTTPS, Ethernet, etc.) as are well known. It will also be appreciated that computer code for implementing embodiments can be implemented in any programming language that can be executed on a client system and/or server or server system such as, for example, C, C++, HTML, any other markup language, Java™, JavaScript, ActiveX, any other scripting language, such as VBScript, and many other programming languages as are well known may be used. (Java™ is a trademark of Sun Microsystems, Inc.).

According to one embodiment, each system 816 is configured to provide webpages, forms, applications, data and media content to user (client) systems 812 to support the access by user systems 812 as tenants of system 816. As such, system 816 provides security mechanisms to keep each tenant's data separate unless the data is shared. If more than one MTS is used, they may be located in close proximity to one another (e.g., in a server farm located in a single building or campus), or they may be distributed at locations remote from one another (e.g., one or more servers located in city A and one or more servers located in city B). As used herein, each MTS could include one or more logically and/or physically connected servers distributed locally or across one or more geographic locations. Additionally, the term “server” is meant to include a computer system, including processing hardware and process space(s), and an associated storage system and database application (e.g., OODBMS or RDBMS) as is well known in the art. It should also be understood that “server system” and “server” are often used interchangeably herein. Similarly, the database object described herein can be implemented as single databases, a distributed database, a collection of distributed databases, a database with redundant online or offline backups or other redundancies, etc., and might include a distributed database or storage network and associated processing intelligence.

FIG. 9 also illustrates environment 810. However, in FIG. 9 elements of system 816 and various interconnections in an embodiment are further illustrated. FIG. 9 shows that user system 812 may include processor system 812A, memory system 812B, input system 812C, and output system 812D. FIG. 9 shows network 814 and system 816. FIG. 9 also shows that system 816 may include tenant data storage 822, tenant data 823, system data storage 824, system data 825, User Interface (UI) 930, Application Program Interface (API) 932, PL/SQL 934, save routines 936, application setup mechanism 938, applications servers 900 ₁-900 _(N), system process space 902, tenant process spaces 904, tenant management process space 910, tenant storage space 912, tenant data 914, and application metadata 916. In other embodiments, environment 810 may not have the same elements as those listed above and/or may have other elements instead of, or in addition to, those listed above.

User system 812, network 814, system 816, tenant data storage 822, and system data storage 824 were discussed above in FIG. 8. Regarding user system 812, processor system 812A may be any combination of one or more processors. Memory system 812B may be any combination of one or more memory devices, short term, and/or long term memory. Input system 812C may be any combination of input devices, such as one or more keyboards, mice, trackballs, scanners, cameras, and/or interfaces to networks. Output system 812D may be any combination of output devices, such as one or more monitors, printers, and/or interfaces to networks. As shown by FIG. 9, system 816 may include a network interface 820 (illustrated in FIG. 8) implemented as a set of HTTP application servers 900, an application platform 818, tenant data storage 822, and system data storage 824.

Also shown in FIG. 9 is system process space 902, including individual tenant process spaces 904 and a tenant management process space 910. Each application server 900 may be configured to tenant data storage 822 and the tenant data 823 therein, and system data storage 824 and the system data 825 therein to serve requests of user systems 812. The tenant data 823 might be divided into individual tenant storage spaces 912, which can be either a physical arrangement and/or a logical arrangement of data. Within each tenant storage space 912, tenant data 914 and application metadata 916 might be similarly allocated for each user. For example, a copy of a user's most recently used (MRU) items might be stored to tenant data 914. Similarly, a copy of MRU items for an entire organization that is a tenant might be stored to tenant storage space 912. A UI 930 provides a user interface and an API 932 provides an application programmer interface to system 816 resident processes to users and/or developers at user systems 812. The tenant data and the system data may be stored in various databases, such as one or more Oracle™ databases.

Application platform 818 includes an application setup mechanism 938 that supports application developers' creation and management of applications, which may be saved as metadata into tenant data storage 822 by save routines 936 for execution by subscribers as one or more tenant process spaces 904 managed by tenant management process 910 for example. Invocations to such applications may be coded using PL/SQL 934 that provides a programming language style interface extension to API 932. A detailed description of some PL/SQL language embodiments is discussed in commonly owned U.S. Pat. No. 7,730,478 entitled, “Method and System for Allowing Access to Developed Applicants via a Multi-Tenant Database On-Demand Database Service”, issued Jun. 1, 2010 to Craig Weissman, which is incorporated in its entirety herein for all purposes. Invocations to applications may be detected by one or more system processes, which manage retrieving application metadata 916 for the subscriber making the invocation and executing the metadata as an application in a virtual machine.

Each application server 900 may be communicably coupled to database systems, e.g., having access to system data 825 and tenant data 823, via a different network connection. For example, one application server 900 ₁ might be coupled via the network 814 (e.g., the Internet), another application server 900 _(N-1) might be coupled via a direct network link, and another application server 900 _(N) might be coupled by yet a different network connection. Transfer Control Protocol and Internet Protocol (TCP/IP) are typical protocols for communicating between application servers 900 and the database system. However, it will be apparent to one skilled in the art that other transport protocols may be used to optimize the system depending on the network interconnect used.

In certain embodiments, each application server 900 is configured to handle requests for any user associated with any organization that is a tenant. Because it is desirable to be able to add and remove application servers from the server pool at any time for any reason, there is preferably no server affinity for a user and/or organization to a specific application server 900. In one embodiment, therefore, an interface system implementing a load balancing function (e.g., an F5 Big-IP load balancer) is communicably coupled between the application servers 900 and the user systems 812 to distribute requests to the application servers 900. In one embodiment, the load balancer uses a least connections algorithm to route user requests to the application servers 900. Other examples of load balancing algorithms, such as round robin and observed response time, also can be used. For example, in certain embodiments, three consecutive requests from the same user could hit three different application servers 900, and three requests from different users could hit the same application server 900. In this manner, system 816 is multi-tenant, wherein system 816 handles storage of, and access to, different objects, data and applications across disparate users and organizations.

As an example of storage, one tenant might be a company that employs a sales force where each salesperson uses system 816 to manage their sales process. Thus, a user might maintain contact data, leads data, customer follow-up data, performance data, goals and progress data, etc., all applicable to that user's personal sales process (e.g., in tenant data storage 822). In an example of a MTS arrangement, since all of the data and the applications to access, view, modify, report, transmit, calculate, etc., can be maintained and accessed by a user system having nothing more than network access, the user can manage his or her sales efforts and cycles from any of many different user systems. For example, if a salesperson is visiting a customer and the customer has Internet access in their lobby, the salesperson can obtain critical updates as to that customer while waiting for the customer to arrive in the lobby.

While each user's data might be separate from other users' data regardless of the employers of each user, some data might be organization-wide data shared or accessible by a plurality of users or all of the users for a given organization that is a tenant. Thus, there might be some data structures managed by system 816 that are allocated at the tenant level while other data structures might be managed at the user level. Because an MTS might support multiple tenants including possible competitors, the MTS should have security protocols that keep data, applications, and application use separate. Also, because many tenants may opt for access to an MTS rather than maintain their own system, redundancy, up-time, and backup are additional functions that may be implemented in the MTS. In addition to user-specific data and tenant specific data, system 816 might also maintain system level data usable by multiple tenants or other data. Such system level data might include industry reports, news, postings, and the like that are sharable among tenants.

In certain embodiments, user systems 812 (which may be client systems) communicate with application servers 900 to request and update system-level and tenant-level data from system 816 that may require sending one or more queries to tenant data storage 822 and/or system data storage 824. System 816 (e.g., an application server 900 in system 816) automatically generates one or more SQL statements (e.g., one or more SQL queries) that are designed to access the desired information. System data storage 824 may generate query plans to access the requested data from the database.

Each database can generally be viewed as a collection of objects, such as a set of logical tables, containing data fitted into predefined categories. A “table” is one representation of a data object, and may be used herein to simplify the conceptual description of objects and custom objects. It should be understood that “table” and “object” may be used interchangeably herein. Each table generally contains one or more data categories logically arranged as columns or fields in a viewable schema. Each row or record of a table contains an instance of data for each category defined by the fields. For example, a CRM database may include a table that describes a customer with fields for basic contact information such as name, address, phone number, fax number, etc. Another table might describe a purchase order, including fields for information such as customer, product, sale price, date, etc. In some multi-tenant database systems, standard entity tables might be provided for use by all tenants. For CRM database applications, such standard entities might include tables for Account, Contact, Lead, and Opportunity data, each containing pre-defined fields. It should be understood that the word “entity” may also be used interchangeably herein with “object” and “table”.

In some multi-tenant database systems, tenants may be allowed to create and store custom objects, or they may be allowed to customize standard entities or objects, for example by creating custom fields for standard objects, including custom index fields. As indicated above, U.S. patent application Ser. No. 10/817,161, filed Apr. 2, 2004, entitled “Custom Entities and Fields in a Multi-Tenant Database System”, and which is hereby incorporated herein by reference, teaches systems and methods for creating custom objects as well as customizing standard objects in a multi-tenant database system. In certain embodiments, for example, all custom entity data rows are stored in a single multi-tenant physical table, which may contain multiple logical tables per organization. It is transparent to customers that their multiple “tables” are in fact stored in one large table or that their data may be stored in the same table as the data of other customers.

Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.

While concepts been described in terms of several embodiments, those skilled in the art will recognize that embodiments not limited to the embodiments described, but can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of limiting. 

What is claimed is:
 1. A method of sharding message traffic across messaging brokers, the method comprising: providing a message sharding service for message sharding among a plurality of registered message brokers, wherein providing the message sharding service includes applying a current message sharding strategy; and sharding messages among the registered message brokers according to the current message sharding strategy, including registering the message brokers and assigning message queues to registered message brokers according to the current message sharding strategy; wherein the current message sharding strategy is one of a plurality of message sharding strategies.
 2. The method of claim 1, wherein the message sharding service is between the plurality of message brokers and a routing table.
 3. The method of claim 2, wherein the routing table is a customer of the message sharding service.
 4. The method of claim 1, wherein the plurality of sharding strategies include: sharding to load balance traffic across registered message brokers; and sharding using an active message broker and a passive message broker.
 5. The method of claim 1, further comprising switching the current message sharding strategy for the message sharding service to another message sharding strategy in response to an instruction.
 6. The method of claim 5, wherein the instruction regarding the message sharding strategy utilizes an XML configuration file.
 7. The method of claim 1, wherein the current message sharding strategy may be switched with a different message sharding strategy in response to one or more of a change in current conditions or a change in a user preference.
 8. The method of claim 1, wherein providing the message sharding service includes providing a plurality of application programing interfaces (APIs) for message sharing operations.
 9. The method of claim 8, wherein the plurality of APIs includes one or more of APIs to: register a message broker with the message sharding service; unregister a message broker from the message sharding service; obtain a message broker for a message queue; drop a message queue from a message broker; and redistribute message queues among certain registered message brokers.
 10. The method of claim 1, wherein the message sharding service includes a routing table sweeper job to determine a destination message broker for queues assigned to new routing rules, and to determine a correct message broker for existing routing rules that are currently assigned to a wrong broker according to the message sharding strategy.
 11. A method for recovery from message broker failure, the method comprising: determining a health status of each of a plurality of message brokers by a broker monitor of a broker sharding service; upon determining that a first message broker is unavailable, notifying a routing table regarding the unavailable broker; redistributing message queues from the first message broker to one or more remaining message brokers according to a selected message sharding strategy, the selected message sharding strategy being implemented by the broker sharding service, the selected message sharding strategy being one of a plurality of possible message sharding strategies; and notifying the routing table regarding the redistribution of message queues.
 12. The method of claim 11, further comprising: unregistering the first message broker from a broker registry, and updating a queue registry regarding the redistribution of message queues.
 13. The method of claim 11, wherein determining a health status of each of the plurality of message brokers includes determining one or more of: whether the message broker is down; whether the message broker has excessively high processor usage, and whether the message broker has an excessively high heap value.
 14. The method of claim 11, wherein the selected message sharding strategy is one of: a first sharding strategy to load balance traffic across registered message brokers; and a second sharding strategy applying an active message broker and a passive message broker, wherein all message queues used by the routing table are allocated to the active broker.
 15. The method of claim 11, wherein, for the first sharding strategy, redistributing message queues includes balancing traffic among available registered message brokers.
 16. The method of claim 15, wherein redistributing message queues among available registered message brokers includes allocation using modulo hashing of node ID.
 17. The method of claim 11, wherein, for the second sharding strategy, redistributing message queues includes allocating all of the message queues of the active broker to the passive broker, and designating the passive broker as the active broker.
 18. A messaging system comprising: a plurality of message brokers, the message brokers to store queues of messages; a routing table to map message types and tenants to physical queues on the message brokers; and a message sharding service to provide message sharding among the plurality of message brokers according to a message sharding strategy; wherein the message sharding service is operable to switch between two or more message sharding strategies.
 19. The system of claim 18, wherein the message sharding service includes a broker monitor to monitor the health of the plurality of message brokers.
 20. The system of claim 19, wherein the broker monitor includes a broker registry for the registration of message brokers.
 21. The system of claim 18, wherein the message sharding service includes a queue registry for the registration of reserved queues.
 22. The system of claim 18, wherein the message sharding service provides a plurality of application programming interfaces (APIs) for message sharding operations.
 23. The system of claim 22, wherein the plurality of APIs includes one or more of APIs to: register a message broker with the message sharding service; unregister a message broker from the message sharding service; obtain a message broker for a message queue; drop a message queue from a message broker; and redistribute message queues among registered message brokers.
 24. The system of claim 18, wherein the message sharding service includes a routing table sweeper job to determine a destination message broker for queues assigned to new routing rules, and to determine a correct message broker for existing routing rules that are currently assigned to a wrong broker according to the message sharding strategy.
 25. A non-transitory computer-readable storage medium having stored thereon data representing sequences of instructions that, when executed by a processor, cause the processor to perform operations comprising: providing a message sharding service for message sharding among a plurality of registered message brokers, wherein providing the message sharding service includes applying a current message sharding strategy; and sharding messages among the registered message brokers according to the current message sharding strategy, including registering the message brokers and assigning message queues to registered message brokers according to the current message sharding strategy; wherein the current message sharding strategy is one of a plurality of message sharding strategies.
 26. The medium of claim 24, further comprising instructions that, when executed by the processor, cause the processor to perform operations comprising: determining a health status of each of the plurality of registered message brokers by a broker monitor of the message sharding service; upon determining that a first message broker is unavailable, notifying a routing table regarding the unavailable broker; redistributing message queues from the first message broker to one or more remaining message brokers according to the current message sharding strategy; and notifying the routing table regarding the redistribution of message queues. 